package com.chuan.thinkingjava.schedule;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;

public class TimerTest {
	
	public static void main(String[] args) {
		Timer timer = new Timer("2");
		
		new Timer().schedule(new TimerTask() {
			
			@Override
			public void run() {
				System.out.println(1);
				System.out.println(Thread.currentThread().getName());
				
			}
		}, 5000, 1000);
//		int num = 10;
//		System.out.println(10 << 1);
//		Runnable runnable = new Runnable() {
//			
//			@Override
//			public void run() {
//				while (true) {
//					System.out.println(1);
//					try {
//						Thread.sleep(1000);
//					} catch (Exception e) {
//						e.printStackTrace();
//					}
//				}
//			}
//		};
//		Thread thread = new Thread(runnable);
//		thread.start();
		Map<Object, Object> map = new HashMap<>();
		Set<Entry<Object, Object>> entrySet = map.entrySet();
	}
}
